#!/bin/bash

# Script to push code to Gitee repository
# Usage: ./push_to_gitee.sh "Your commit message"

# Check if commit message is provided
if [ -z "$1" ]; then
    echo "Error: Please provide a commit message."
    echo "Usage: ./push_to_gitee.sh \"Your commit message\""
    exit 1
fi

# Add all files
git add .

# Commit with the provided message
git commit -m "$1"

# Push to Gitee
echo "Pushing to Gitee repository..."
git push -u origin main

# Check if push was successful
if [ $? -eq 0 ]; then
    echo "Successfully pushed to Gitee repository!"
    echo "Visit your repository at: https://gitee.com/gitdotkon/databasearchive"
else
    echo "Failed to push to Gitee repository."
    echo "You might need to provide your Gitee credentials."
    echo "Try running: git push -u origin main"
fi
